<?php


namespace App\Remote\Feishu\Message;


use GuzzleHttp\Exception\GuzzleException;
use Symfony\Component\HttpFoundation\Request as RequestAlias;

class FeishuMsgRemote extends FeishuRemote
{


    /**
     * 基础请求头构建
     *
     * @return array
     */
    public static function buildBasicHeaders(): array
    {
        return [
            'Content-Type'  => "application/json; charset=utf-8",
            'Authorization' => FeishuAuthRemote::getInstance()->getAccessToken()
        ]; // TODO: Change the autogenerated stub
    }


    /**
     * 发送富文本信息
     *
     * @param array $msgContent
     * @param array $userIds
     * @return mixed|void
     * @throws GuzzleException
     */
    public function batchSendPostMsg(array $msgContent, array $userIds)
    {
        return self::customRequest(
            "/open-apis/message/v4/batch_send",
            RequestAlias::METHOD_POST,
            [
                "msg_type" => "post",
                "content"  => $msgContent,
                "user_ids" => $userIds
            ]
        );
    }


}
